package com.jyxd.web.controller.patient;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jyxd.web.data.common.Result;
import com.jyxd.web.data.patient.PatientCureEvent;
import com.jyxd.web.service.patient.IPatientCureEventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 诊疗时间轴信息 前端控制器
 * </p>
 *
 * @author baomidou
 * @since 2022-09-20
 */
@RestController
@RequestMapping("/patientCureEvent")
public class PatientCureEventController {
    @Autowired
    private IPatientCureEventService patientCureEventService;

    @RequestMapping("/queryList/{patientId}")
    public Result<?> queryList(@PathVariable("patientId") String patientId) {
        Wrapper<PatientCureEvent> wrapper = new QueryWrapper<PatientCureEvent>().eq("patient_id",patientId).orderByAsc("event_date");;
        List<PatientCureEvent> list = patientCureEventService.list(wrapper);
        return Result.succeed(list);
    }
}
